import delimited using "C:\Users\jkbrueck\Documents\STATA\Fuel 4\market_values_scrap.csv", clear

*imports market values for planes operating in 2015-2019 period

gen d2017 = 0
gen d2019 = 0
replace d2017 = 1 if yr == 2017
replace d2019 = 1 if yr == 2019

gen fuelpr = 0
replace fuelpr = 0.982 if yr == 2015
replace fuelpr = 0.953 if yr == 2017
replace fuelpr = 0.976 if yr == 2019

gen widebody = 0
replace widebody = 1 if type == "A300-600" | type == "A300-600R" | type == "A310-300" | /// 
type == "A330-200" | type == "A330-300" | type == "A350-900" | type == "747-200B" | ///
type == "747-300" | type == "747-400" | type == "767-200ER" | type == "767-300" | ///
type == "767-300ER" | type == "767-400ER" | type == "777-200" | type == "777-200ER" | ///
type == "777-300ER" | type == "787-8" | type == "787-9"

gen airbus = 0
replace airbus = 1 if manuf == "Airbus"

gen age = yr - manuf_yr
gen lmkt_value = log(mkt_value)
summarize mkt_value age capy eff range engines airbus widebody d2017 d2019

*hedonic regressions

reg lmkt_value age capy range eff engines airbus fuelpr, vce(cluster type)
reg lmkt_value age capy range eff engines airbus fuelpr widebody, vce(cluster type)
reg lmkt_value age capy range eff engines airbus widebody d2017 d2019, vce(cluster type)

save "C:\Users\jkbrueck\Documents\STATA\Fuel 4\market_values_scrap", replace




